#定义函数 无参数
def printhello():
    print("hello world")
#调用函数
printhello()#想要几个调用几行

#定义求和函数,有参数
def add(a,b):
    print(a+b)#打印出来的是后面相加的值
add(10,20)

#冒泡排序定义成函数
blist = [11,34,27,30,45,55,34]

alist = [22,49,29,48,48,42,58]
for i in range(0,len(alist)-1):
    for j in range(0,len(alist)-1-i):
        if alist[j] > alist[j+1]:
            alist[j], alist[j+1] = alist[j+1], alist[j]

def mysort(hanshulist):
    for i in range(0, len(hanshulist) - 1):
        for j in range(0, len(hanshulist) - 1 - i):
            if hanshulist[j] > hanshulist[j + 1]:
                hanshulist[j], alist[j + 1] = hanshulist[j + 1], hanshulist[j]

mysort(blist)
mysort(alist)
print(blist)
print(alist)